//
//  Dividend.m
//  MUBATE
//
//  Created by sunbin on 2017/2/27.
//  Copyright © 2017年 Quanli. All rights reserved.
//

#import "Dividend.h"
#import "DividendHead.h"
#import "DividendFooter.h"
#import "DividendCell.h"

static NSString * DividendHeadIdentifier   = @"DividendHeadIdentifier";
static NSString * DividendFooterIdentifier = @"DividendFooterIdentifier";
static NSString * DividendCellIdentifier   = @"DividendCellIdentifier";


@interface Dividend ()
@property (weak, nonatomic) IBOutlet UITableView *tableview;

@end

@implementation Dividend

- (void)viewDidLoad {
    [super viewDidLoad];


    [self initView];[self loadData];
}


- (void)initView{
    [self registerNib];
}

- (void)registerNib{
    [self.tableview registerNib:[UINib nibWithNibName:@"DividendCell" bundle:nil] forCellReuseIdentifier:DividendCellIdentifier];

    [self.tableview registerNib:[UINib nibWithNibName:@"DividendHead" bundle:nil] forHeaderFooterViewReuseIdentifier:DividendHeadIdentifier];
    
    [self.tableview registerNib:[UINib nibWithNibName:@"DividendFooter" bundle:nil] forHeaderFooterViewReuseIdentifier:DividendFooterIdentifier];

}


- (void)loadData{}





- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 3;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    DividendCell *cell = [tableView dequeueReusableCellWithIdentifier:DividendCellIdentifier forIndexPath:indexPath ];
    
    return cell;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    DividendHead *head = [tableView dequeueReusableHeaderFooterViewWithIdentifier:DividendHeadIdentifier];
    
    
    return head;
    
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
    DividendFooter *footer = [tableView dequeueReusableHeaderFooterViewWithIdentifier:DividendFooterIdentifier];
    
    
    return footer;
}


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return kscaleHeight(70);
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return kscaleHeight(140.f);

}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return kscaleHeight(75.f);

}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];


}



@end
